package bit.client.model;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;

public class Main {
    public static void main(String[] argc) {
        Properties prop = new Properties();

        try {
            FileInputStream fp = new FileInputStream("src/settings.properties");
            prop.load(fp);
            String username = prop.getProperty("username");
            String passwd = prop.getProperty("passwd");
            fp.close();
            BitBasic basic = new BitBasic(username, passwd);
            CourseGetter getter = new CourseGetter(basic);
            List<CourseGetter.Course> lis = getter.queryCoursesCurSem();
            CourseGetter.Course[] ans = CourseGetter.getCourseToday(CourseGetter.getCurrentWeek(), lis);
            List<CourseGetter.Course> anss = new ArrayList(Arrays.asList(ans));
            System.out.println("yes");
        } catch (IOException e) {
            System.out.println("no");
            System.out.println(e);
        } catch (PassWdError e) {
            System.out.println("passwd error");
        }
    }
}
